/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package modelo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Santiago.Escobar.M
 */
@Entity
@Table(name = "menuperfil")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Menuperfil.findAll", query = "SELECT m FROM Menuperfil m"),
    @NamedQuery(name = "Menuperfil.findByIdmenuperfil", query = "SELECT m FROM Menuperfil m WHERE m.idmenuperfil = :idmenuperfil")})
public class Menuperfil implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "idmenuperfil")
    private Long idmenuperfil;
    @JoinColumn(name = "idperfil", referencedColumnName = "idperfil")
    @ManyToOne(optional = false)
    private Perfil idperfil;
    @JoinColumn(name = "idmenu", referencedColumnName = "idmenu")
    @ManyToOne(optional = false)
    private Menu idmenu;

    public Menuperfil() {
    }

    public Menuperfil(Long idmenuperfil) {
        this.idmenuperfil = idmenuperfil;
    }

    public Long getIdmenuperfil() {
        return idmenuperfil;
    }

    public void setIdmenuperfil(Long idmenuperfil) {
        this.idmenuperfil = idmenuperfil;
    }

    public Perfil getIdperfil() {
        return idperfil;
    }

    public void setIdperfil(Perfil idperfil) {
        this.idperfil = idperfil;
    }

    public Menu getIdmenu() {
        return idmenu;
    }

    public void setIdmenu(Menu idmenu) {
        this.idmenu = idmenu;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idmenuperfil != null ? idmenuperfil.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Menuperfil)) {
            return false;
        }
        Menuperfil other = (Menuperfil) object;
        if ((this.idmenuperfil == null && other.idmenuperfil != null) || (this.idmenuperfil != null && !this.idmenuperfil.equals(other.idmenuperfil))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "modelo.Menuperfil[ idmenuperfil=" + idmenuperfil + " ]";
    }
    
}
